package com.benjaminwan.read.free.model.bean

import android.text.TextUtils
import com.benjaminwan.read.free.common.BaseUrl

data class ContentAttach(
    val mUrl: String,
    val mTitle: String,
    val mDesc: String
) : ContentAbs() {
    override val content: String
        get() {
            var cnt =
                "<a href=\"" + getFullUrl(mUrl) + "\">" + mTitle + "</a>"
            if (!TextUtils.isEmpty(mDesc)) cnt += "    $mDesc"
            return cnt
        }

    override val copyText: String
        get() = "[附件:$mTitle]"

    companion object {
        fun getFullUrl(url: String): String {
            return BaseUrl + url
        }
    }

}